﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using KeRui.Common;
using System.Collections.Generic;

public partial class Manage_User_Theme : System.Web.UI.Page
{
    public List<KeRui.Model.SysConfig> listTheme;
    protected void Page_Load(object sender, EventArgs e)
    {
        ManageHelper.CheckAdminLogin();

        KeRui.BLL.SysConfig bllTheme = new KeRui.BLL.SysConfig();

        if (ManageHelper.PageAct() == "set")
        {
            string newTheme = PageRequest.GetString("theme");
            if (newTheme.ToLower() != ManageHelper.GetTheme().ToLower())
            {
                KeRui.Model.SysConfig modelTheme = bllTheme.GetModel("ManageTheme", newTheme);
                if (modelTheme != null && modelTheme.IsUsing == 1)
                {
                    ManageHelper.SetTheme(newTheme);
                    Response.Write("<script language='javascript' type='text/javascript'>window.top.location.href = '../main.aspx?url=" + Utils.UrlEncode("user/theme.aspx") + "';</script>");
                    Response.End();
                }
            }
        }

        listTheme = bllTheme.GetList("ManageTheme", 1);

    }
}
